﻿#region License
/* ---------------------------------------------------------------- *
 *
 * This file is part of the Xcoordination Application Space
 * ("XcoAppSpace") http://www.xcoordination.com
 *
 * Copyright (C) 2009 Xcoordination http://www.xcoordination.com
 *
 * XcoAppSpace is free software; you can redistribute it and/or
 * modify it under the terms of version 2 of the GNU General
 * Public License as published by the Free Software Foundation.
 *
 * XcoAppSpace is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see http://www.gnu.org/licenses/
 * or write to the Free Software Foundation, Inc., 51 Franklin
 * Street, Fifth Floor, Boston, MA 02110-1301, USA.
 *
 * ---------------------------------------------------------------- */
#endregion
#if !MF
using System;
using XcoAppSpaces.Contracts.Service;

namespace XcoAppSpaces.Contracts.Security
{
	/// <summary>
	/// Attribute that can be added to a worker or one of its message processor methods or worker extensions to
	/// allow a certain role to access this worker (or only certain ports of the worker).
	/// </summary>
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method | AttributeTargets.Field)]
	public sealed class XcoSecurityPermissionAttribute : XcoServiceAttribute
	{
		/// <summary>
		/// The rolename that should have permission.
		/// </summary>
		public string Rolename { get; set; }

		/// <summary>
		/// Creates a new XcoSecurityPermissionAttribute.
		/// </summary>
		/// <param name="rolename">The rolename that should have permission.</param>
		public XcoSecurityPermissionAttribute(string rolename)
		{
			this.Rolename = rolename;
		}
	}
}
#endif